import request from "@/api/request";

export default {
    userInfo: (param) => {
        return request({
            url: '/user/userInfo/list',
            method: 'post',
            data:param
        })
    },
    // 获得所有考试班级
    getAllTrainClass:(params)=>{
        return request({
            url:"train-class/all",
            method:"post",
            data:params
        })
    },
    /**
     * 获取考试人员
     */
    getExamPerson:()=>{
        return request({
            url:"exam/get",
            method:"get"
        })
    },
    /**
     * 创建考试
     */
    createExam:(params)=>{
        return request({
            url:"/exam/create",
            method:"post",
            data:params
        })
    },
    /**
     * 获取所有考试分页接口
     */
    getExam:(params)=>{
        return request({
            url:"/exam/page",
            method:"post",
            data:params
        })
    },
    /**
     * 更新考试
     */
    updateExam:(params)=>{
        return request({
            url:"/exam/page",
            method:"post",
            data:params
        })
    },
    getPublic: (token) => {
        return request({
            url: '/login/getPublicKey',
            method: 'get',
            headers: {'token': token}
        })
    },
    userLogin:(param,token)=>{
        return request({
            url:'/login/userLogin',
            method:'post',
            headers: {'token': token},
            data:param
        })
    },
    getPhoneCode:(param,token)=>{
        return request({
            url:'/login/getPhoneCode',
            method:'post',
            headers: {'token': token},
            data:param
        })
    },
    adminactivity:(param,token)=>{
        return request({
            url:'/login/adminAcativity',
            method:'post',
            headers: {'token': token},
            data:param
        })
    },
    /**
     * 发布帖子
     * @param token
     * @returns {*}
     */
    createCommunication:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/communication/createCommunication",
            method:"post",
            data: param
        })
    },

    /**
     * 更新帖子点赞数量
     * @param param
     * @param token
     * @returns {*}
     */
    updateCommunicationLikeNum:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/communication/updateCommunicationLikeNum",
            method:"post",
            data: param
        })
    },

    /**
     * 更新帖子收藏数量
     * @param param
     * @param token
     * @returns {*}
     */
    updateCommunicationFavorNum:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/communication/updateCommunicationFavorNum",
            method:"post",
            data: param
        })
    },

    /**
     * 删帖子
     * @param token
     * @returns {*}
     */
    deleteCommunication:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/communication/delete",
            method:"post",
            data: param
        })
    },

    /**
     * 查帖子
     * @param token
     * @returns {*}
     */
    listCommunication:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/communication/list",
            method:"post",
            data: param
        })
    },



    /**
     * 评论帖子
     * @param param
     * @param token
     * @returns {*}
     */
    createComment:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/comment/createCommunication",
            method:"post",
            data: param
        })
    },

    /**
     * 查询帖子评论
     * @param param
     * @param token
     * @returns {*}
     */
    queryComentList:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/comment/queryComentList",
            method:"post",
            data: param
        })
    },

    /**
     * 删除帖子的评论
     * @param param
     * @param token
     * @returns {*}
     */
    deleteComent:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/comment/deleteComent",
            method:"post",
            data: param
        })
    },
    /**
     * 查询用户信息
     * @param param
     * @param token
     * @returns {*}
     */
    userInfolist:(param,token)=>{
        return request({
            headers: {'token': token},
            url:"/user/userInfo/list",
            method:"post",
            data: param
        })
    },
}
